<?php $this->load->view('admin/Public/header'); ?>
  <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
	  <input type="hidden" name="id" value="<?=$_GET['id']?>">
    <div class="layui-form-item">
      <label class="layui-form-label">分组key</label>
      <div class="layui-input-inline">
        <input type="text" name="key" value="<?=$key?>" lay-verify="required" placeholder="请输入分组key" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">分组名称</label>
      <div class="layui-input-inline">
        <input type="text" name="name" value="<?=$name?>" lay-verify="required" placeholder="请输入分组名称" autocomplete="off" class="layui-input">
      </div>
    </div>
  <div class="layui-form-item">
	  <label class="layui-form-label">显示排序</label>
	  <div class="layui-input-inline">
		  <input type="text" name="inx" value="<?=$inx?>" lay-verify="required" placeholder="请输入排序" autocomplete="off" class="layui-input">
	  </div>
  </div>

	  <div class="layui-form-item layui-layout-admin">
		  <div class="layui-input-block">
			  <div class="layui-footer" style="left: 0;">
				  <button class="layui-btn" lay-submit="" id="bc" lay-filter="setmyinfo">保存</button>
			  </div>
		  </div>
	  </div>
  </div>

  <script>

  layui.config({
    base: '/public/layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'form'], function(){
    var $ = layui.$
    ,form = layui.form;

      //提交
      form.on('submit(setmyinfo)', function(obj){
          //请求登入接口
          $.ajax({
              type: "POST",
              url: "/admin/Setting/set_edit",
              data: {data:obj.field},
              dataType: "json",
              success: function(data){
                  if(data.code == 1){
                      layer.msg(data.content, {
                          offset: '15px'
                          ,icon: 1
                          ,time: 1000
                      }, function(){
                          parent.location.reload();
                      });
                  }else{
                      layer.msg(data.content, {
                          offset: '15px'
                          ,icon: 2
                          ,time: 1000
                      });
                  }
              }
          });

      })
  })
  </script>
</body>
</html>
